<template>
  <div class="form-search-setting" v-if="!hasParentField">
    <el-checkbox :value="field.isSearch" @input="update" :true-label="1" :false-label="0">{{$t('common.base.allowadvancedSearch')}}</el-checkbox>
  </div>
</template>

<script>
/* props */
import { settingProps } from '@src/component/form/components/props';

export default {
  name: 'form-search-setting',
  props: {
    ...settingProps
  },
  computed: {
    hasParentField() {
      return !!this.field.parentFieldId
    }
  },
  methods: {
    update(value) {
      this.$emit('input', value, 'isSearch');
    }
  }
}
</script>